<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="renderer" content="webkit">
<title>铁水联运信息核查系统--会员信息管理</title>
	<link rel="shortcut icon" href="${mainDomain}/statics/images/favicon.ico">
    <link rel="stylesheet" href="${mainDomain}/statics/css/front/amazeui.min.css"/>
  	<link rel="stylesheet" href="${mainDomain}/statics/css/front/admin.css">
    <link rel="stylesheet" media="screen" href="${mainDomain}/statics/css/front/bootstrap.min.css" >
    <link rel="stylesheet" media="screen" href="${mainDomain}/statics/css/front/bootstrap-datetimepicker.min.css" >
    <script type="text/javascript">
        var mainDomain = "${mainDomain}";
		var miscDomain = '${mainDomain}';
    </script>
</head>
<body>
<#include "common/memberheader.ftl" />
<div class="am-cf admin-main">
	<#include "common/memberleft.ftl" />
	<!-- content start -->
<div class="admin-content">
    <div class="admin-content-body">
        <div class="am-cf am-padding am-padding-bottom-0">
            <div class="am-fl am-cf">
                <strong class="am-text-primary am-text-lg">会员信息</strong> /
                <small>会员信息管理</small>
            </div>
        </div>

        <hr>


        <form id="my-form" class="am-form" action="javascript:;" method="post" data-am-validator>
        	<input type="hidden" id="logofilename" name="logofilename" value="${(yhxx.qytx)!''}"/>
        	<input type="hidden" id="yhid" name="yhid" value="${(yhxx.yhid)!''}"/>
        	<input type="hidden" id="yyzzfilename" name="yyzzfilename" value="${(yyzz)!''}"/>
        	<input type="hidden" id="zzjgfilename" name="zzjgfilename" value="${(zzjg)!''}"/>
        	<input type="hidden" id="swdjfilename" name="swdjfilename" value="${(swdj)!''}"/>
        	<input type="hidden" id="qyzzfilename" name="qyzzfilename" value="${(qyzz)!''}"/>
        	<input type="hidden" id="wtzmfilename" name="wtzmfilename" value="${(wtzm)!''}"/>
        	<input type="hidden" id="wtzmfilename" name="wtzmfilename" value="${(wtzm)!''}"/>
        	<input type="hidden" id="szhyfilename" name="szhyfilename" value="${(szhy)!''}"/>
        	<input type="hidden" id="qyjjfilename" name="qyjjfilename" value="${(yhxx.jjtp)!''}"/>
        	<input type="hidden" id="qytype" name="qytype" value="${(yhxx.yhlx)!''}"/>
        	<input type="hidden" id="isnew" name="isnew" value="${(isnew)!''}"/>
        	<input type="hidden" id="id" name="id" value="${(yhxx.id)!''}"/>
            
            <div class="am-g am-margin-top" id="demo">
                <div class="am-u-sm-4 am-u-md-2 am-text-right">上传企业logo</div>
                <div class="am-u-sm-8 am-u-md-4 am-u-end col-end fileup">
                    <div class="am-form-file"  style="width:50%">
					  <button type="button" class="am-btn am-btn-danger am-btn-sm">
						<i class="am-icon-cloud-upload"></i> 选择要上传的文件</button>
					  <input id="file" name="file" type="file">
					</div>
					<input type="button" class="am-btn am-btn-primary am-btn-xs" value="上传" onclick="return ajaxDemoUpload();">
                </div>
				<div id="file-list"></div>
            </div>
            <div class="am-g am-margin-top">
                <div class="am-u-sm-4 am-u-md-2 am-text-right">
                    企业全称
                </div>
                <div class="am-u-sm-8 am-u-md-4 am-form-group">
                    <input type="text" id="qyqc" name="qyqc" value="${(yhxx.qyqc)!''}" maxlength="30" class="am-input-sm" placeholder="请输入企业全称" data-validation-message="请输入企业全称" required>
                </div>
                <div class="am-hide-sm-only am-u-md-6 am-text-danger" id="qyqc_tips">＊ 必填</div>
            </div>
			<!--<div class="am-g am-margin-top">
                <div class="am-u-sm-4 am-u-md-2 am-text-right">
                    企业简称
                </div>
                <div class="am-u-sm-8 am-u-md-4 am-u-end">
                    <input type="text" value="${(yhxx.qyjc)!''}" name="qyjc" maxlength="15" class="am-input-sm" placeholder="请输入企业简称">
                </div>
                <div class="am-hide-sm-only am-u-md-6 am-text-danger" id="qyjc_tips"></div>
            </div>-->
			<div class="am-g am-margin-top">
                <div class="am-u-sm-4 am-u-md-2 am-text-right">
                    企业网址
                </div>
                <div class="am-u-sm-8 am-u-md-4 am-u-end am-form-group">
                    <input type="url" value="${(yhxx.qywz)!''}" maxlength="30" name="qywz" class="am-input-sm" placeholder="请输入企业网址" data-validation-message="请输入正确网站地址">
                </div>
                <div class="am-hide-sm-only am-u-md-6 am-text-danger" id="qywz_tips"></div>
            </div>
			<div class="am-g am-margin-top">
                <div class="am-u-sm-4 am-u-md-2 am-text-right">
                    <#if yhxx.yhlx!=8>企业联系人<#else>姓名</#if>
                </div>
                <div class="am-u-sm-8 am-u-md-4 am-form-group">
                    <input type="text" value="${(yhxx.lxrxm)!''}" maxlength="5" id="lxrxm" name="lxrxm" class="am-input-sm" placeholder="请输入企业联系人" data-validation-message="请输入企业联系人" maxlength=5 required>
                </div>
                <div class="am-hide-sm-only am-u-md-6 am-text-danger" id="lxrxm_tips">＊ 必填</div>
            </div>
            <#if yhxx.yhlx!=8>
				<div class="am-g am-margin-top">
	                <div class="am-u-sm-4 am-u-md-2 am-text-right">
	                    联系人座机
	                </div>
	                <div class="am-u-sm-8 am-u-md-4 am-u-end">
	                    <input type="text" value="${(yhxx.lxrzj)!''}" maxlength="15" name="lxrzj" class="am-input-sm" placeholder="请输入联系人座机" maxlength=15>
	                </div>
	                <div class="am-hide-sm-only am-u-md-6 am-text-danger" id="lxrzj_tips"></div>
	            </div>
            </#if>
			<div class="am-g am-margin-top">
                <div class="am-u-sm-4 am-u-md-2 am-text-right">
                  	联系人手机
                </div>
                <div class="am-u-sm-8 am-u-md-4 am-form-group">
                    <input type="number" value="${(yhxx.lxrsj)!''}" id="lxrsj" name="lxrsj" class="am-input-sm" placeholder="请输入联系人手机" data-validation-message="请输入企业手机" maxlength=11 required>
                </div>
				<div class="am-hide-sm-only am-u-md-6 am-text-danger" id="lxrsj_tips">＊ 必填</div>
            </div>
			<div class="am-g am-margin-top">
                <div class="am-u-sm-4 am-u-md-2 am-text-right">
                    	联系人邮箱
                </div>
                <div class="am-u-sm-8 am-u-md-4 am-form-group">
                    <input type="email" value="${(yhxx.lxremail)!''}" maxlength="50" name="lxremail" class="am-input-sm" id="lxremail" placeholder="请输入联系人邮箱" data-validation-message="请输入正确电子邮箱" required>
                </div>
				<div class="am-hide-sm-only am-u-md-6 am-text-danger" id="lxremail_tips">＊ 必填</div>
            </div>	

            <div class="am-g am-margin-top">
                <div class="am-u-sm-4 am-u-md-2 am-text-right">
                   客服QQ
                </div>
                <div class="am-u-sm-8 am-u-md-4 am-form-group">
                    <input type="number" value="${(yhxx.kfqq)!''}" maxlength="20" name="kfqq" class="am-input-sm" id="kfqq" placeholder="请输入客服QQ" data-validation-message="请输入正确客服QQ" required>
                </div>
				<div class="am-hide-sm-only am-u-md-6 am-text-danger" id="kfqq_tips">＊ 必填</div>
            </div>
            
           <!-- <div class="am-g am-margin-top-sm">
              <div class="am-u-sm-4 am-u-md-2 am-text-right">
                企业简介
              </div>
              <div class="am-u-sm-8 am-u-md-4 am-u-end">
                <textarea rows="10" name="qyjj">${(yhxx.qyjj)!''}</textarea>
              </div>
            </div>
            
            <div class="am-g am-margin-top-sm">
              <div class="am-u-sm-4 am-u-md-2 am-text-right">
                主营业务
              </div>
              <div class="am-u-sm-8 am-u-md-4 am-u-end">
                <textarea rows="10" name="zyyw">${(yhxx.zyyw)!''}</textarea>
              </div>
            </div>-->
            
            <div class="am-g am-margin-top fileup01" id="jjtpdiv">
                <div class="am-u-sm-4 am-u-md-2 am-text-right">上传企业简介图片</div>
                <div class="am-u-sm-8 am-u-md-4 am-u-end col-end">
                    <div class="am-form-file"  style="width:50%">
					  <button type="button" class="am-btn am-btn-danger am-btn-sm">
						<i class="am-icon-cloud-upload"></i> 选择要上传的文件</button>
					  <input id="jjtpfile" name="jjtpfile" type="file" >
					</div>
					<input type="button" class="am-btn am-btn-primary am-btn-xs" value="上传" onclick="return ajaxjjtpUpload();">
                </div>
				<div id="jjtpfile-list"></div>
            </div>
            
            <#if szhy==''>
			<div class="am-g am-margin-top  fileup01" id="yyzzdiv">
                <div class="am-u-sm-4 am-u-md-2 am-text-right">上传企业营业执照</div>
                <div class="am-u-sm-8 am-u-md-4 am-u-end col-end">
                    <div class="am-form-file"  style="width:50%">
					  <button type="button" class="am-btn am-btn-danger am-btn-sm">
						<i class="am-icon-cloud-upload"></i> 选择要上传的文件</button>
					  <input id="yyzzfile" name="yyzzfile" type="file" >
					</div>
					<input type="button" class="am-btn am-btn-primary am-btn-xs" value="上传" onclick="return ajaxyyzzUpload();">
                </div>
				<div id="yyzzfile-list"></div>
				<div class="am-hide-sm-only am-u-md-6 am-text-danger" id="yyzzfile_tips">＊ 必填</div>
            </div>
            
            <div class="am-g am-margin-top fileup01" id="zzjgdiv">
                <div class="am-u-sm-4 am-u-md-2 am-text-right">上传企业组织机构代码证</div>
                <div class="am-u-sm-8 am-u-md-4 am-u-end col-end">
                    <div class="am-form-file"  style="width:50%">
					  <button type="button" class="am-btn am-btn-danger am-btn-sm">
						<i class="am-icon-cloud-upload"></i> 选择要上传的文件</button>
					  <input id="zzjgfile" name="zzjgfile" type="file" >
					</div>
					<input type="button" class="am-btn am-btn-primary am-btn-xs" value="上传" onclick="return ajaxzzjgUpload();">
                </div>
				<div id="zzjgfile-list"></div>
				<div class="am-hide-sm-only am-u-md-6 am-text-danger" id="zzjgfile_tips">＊ 必填</div>
            </div>
            
            <div class="am-g am-margin-top fileup01" id="swdjdiv">
                <div class="am-u-sm-4 am-u-md-2 am-text-right">上传企业税务登记证</div>
                <div class="am-u-sm-8 am-u-md-4 am-u-end col-end">
                    <div class="am-form-file"  style="width:50%">
					  <button type="button" class="am-btn am-btn-danger am-btn-sm">
						<i class="am-icon-cloud-upload"></i> 选择要上传的文件</button>
					  <input id="swdjfile" name="swdjfile" type="file" >
					</div>
					<input type="button" class="am-btn am-btn-primary am-btn-xs" value="上传" onclick="return ajaxswdjUpload();">
                </div>
				<div id="swdjfile-list"></div>
				<div class="am-hide-sm-only am-u-md-6 am-text-danger" id="swdjfile_tips">＊ 必填</div>
            </div>
            <#else>
            	<div class="am-g am-margin-top  fileup01" id="szhydiv">
	                <div class="am-u-sm-4 am-u-md-2 am-text-right">上传三证合一</div>
	                <div class="am-u-sm-8 am-u-md-4 am-u-end col-end">
	                    <div class="am-form-file"  style="width:50%">
						  <button type="button" class="am-btn am-btn-danger am-btn-sm">
							<i class="am-icon-cloud-upload"></i> 选择要上传的文件</button>
						  <input id="szhyfile" name="szhyfile" type="file" >
						</div>
						<input type="button" class="am-btn am-btn-primary am-btn-xs" value="上传" onclick="return ajaxszhyUpload();">
	                </div>
					<div id="szhyfile-list"></div>
					<div class="am-hide-sm-only am-u-md-6 am-text-danger" id="szhyfile_tips">＊ 必填</div>
	            </div>
            </#if>
            
            <div class="am-g am-margin-top fileup01" id="qyzzdiv">
                <div class="am-u-sm-4 am-u-md-2 am-text-right">上传企业资质</div>
                <div class="am-u-sm-8 am-u-md-4 am-u-end col-end">
                    <div class="am-form-file"  style="width:50%">
					  <button type="button" class="am-btn am-btn-danger am-btn-sm">
						<i class="am-icon-cloud-upload"></i> 选择要上传的文件</button>
					  <input id="qyzzfile" name="qyzzfile" type="file">
					</div>
					<input type="button" class="am-btn am-btn-primary am-btn-xs" value="上传" onclick="return ajaxqyzzUpload();">
                </div>
				<div id="qyzzfile-list"></div>
            </div>
            
            <div class="am-g am-margin-top fileup01" id="wtzmdiv">
                <div class="am-u-sm-4 am-u-md-2 am-text-right">上传企业注册委托证明</div>
                <div class="am-u-sm-8 am-u-md-4 am-u-end col-end">
                    <div class="am-form-file"  style="width:50%">
					  <button type="button" class="am-btn am-btn-danger am-btn-sm">
						<i class="am-icon-cloud-upload"></i> 选择要上传的文件</button>
					  <input id="wtzmfile" name="wtzmfile" type="file">
					</div>
					<input type="button" class="am-btn am-btn-primary am-btn-xs" value="上传" onclick="return ajaxwtzmUpload();">
                </div>
				<div id="wtzmfile-list"></div>
				<div class="am-hide-sm-only am-u-md-6 am-text-danger" id="wtzmfile_tips">＊ 必填</div>
            </div>
      

            <div class="am-margin">
                <button type="submit" id="saveButton" class="am-btn am-btn-primary am-btn-xs">提交保存</button>
            </div>
        </form>

    </div>
</div>
<!-- content end -->

</div>
</div>
<a href="#" class="am-icon-btn am-icon-th-list am-show-sm-only admin-menu"
   data-am-offcanvas="{target: '#admin-offcanvas'}"></a>
<#include "common/memberfooter.ftl" />
</div>
	<script type="text/javascript" src="${mainDomain}/statics/js/front/jquery-1.9.1.min.js"></script>
	<script type="text/javascript" src="${mainDomain}/statics/js/front/amazeui.min.js"></script>
	<script type="text/javascript" src="${mainDomain}/statics/js/front/ajaxfileupload.js"></script>
	
	<script>
	$('#my-form').validator(
    {
        validate: function (validity) {
        	if ($(validity.field).is('#qyqc')) {
        		if($.trim($("#qyqc").val()).length>30)
            	{
            		validity.valid = false;
            		$('#qyqc_tips').html("企业全称最多填30位");
            	}
            	else if($.trim($("#qyqc").val())=="")
            	{
            		validity.valid = false;
            		$('#qyqc_tips').html("*必填");
            	}
            	else
			    {
			    	validity.valid = true;
                    $('#qyqc_tips').html("");
			    }
        	}
        	if ($(validity.field).is('#qyjc')) {
        		if($.trim($("#qyjc").val()).length>15)
            	{
            		validity.valid = false;
            		$('#qyjc_tips').html("企业全称最多填15位");
            	}
            	else
			    {
			    	validity.valid = true;
                    $('#qyjc_tips').html("");
			    }
        	}
        	if ($(validity.field).is('#lxrxm')) {
        		if($.trim($("#lxrxm").val()).length>5)
            	{
            		validity.valid = false;
            		$('#lxrxm_tips').html("姓名最多填5位");
            	}
            	else if($.trim($("#lxrxm").val())=="")
            	{
            		validity.valid = false;
            		$('#lxrxm_tips').html("*必填");
            	}
            	else
			    {
			    	validity.valid = true;
                    $('#lxrxm_tips').html("");
			    }
        	}
        	if ($(validity.field).is('#lxrzj')) {
        		if($.trim($("#lxrzj").val()).length>15)
            	{
            		validity.valid = false;
            		$('#lxrzj_tips').html("座机最多填15位");
            	}
            	else
			    {
			    	validity.valid = true;
                    $('#lxrzj_tips').html("");
			    }
        	}
        	
        	if ($(validity.field).is('#kfqq')) {
        		if($.trim($("#kfqq").val()).length>20)
            	{
            		validity.valid = false;
            		$('#kfqq_tips').html("QQ号最多填20位");
            	}
    			else if($.trim($("#kfqq").val())=="")
            	{
            		validity.valid = false;
            		$('#kfqq_tips').html("*必填");
            	}
            	else
			    {
			    	validity.valid = true;
                    $('#kfqq_tips').html("");
			    }
        	}
        	
        	if ($(validity.field).is('#lxrsj')) {
        		if($.trim($("#lxrsj").val())==""||$.trim($("#lxrsj").val()).length!=11)
            	{
            		validity.valid = false;
            		$('#lxrsj_tips').html("手机号只能11位");
            	}
            	else
			    {
			    	validity.valid = true;
                    $('#lxrsj_tips').html("");
			    }
        	}
        	if ($(validity.field).is('#lxremail')) {
            	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
            	if (!filter.test($.trim($("#lxremail").val()))||$.trim($("#lxremail").val())=="")
            	{
            		validity.valid = false;
            		$('#lxremail_tips').html("请输入正确的邮箱格式");
            	}
            	else
			    {
			    	validity.valid = true;
                    $('#lxremail_tips').html("");
			    }
            }
            if ($(validity.field).is('#szhyfile')) {
        		var szhyfilename=$("#szhyfilename");
              	if($.trim(szhyfilename.val())==''){
                     validity.valid = false;
            		 $('#szhyfile_tips').html("三证合一必填");
               	}
            	else
			    {
			    	validity.valid = true;
                    $('#szhyfile_tips').html("");
			    }
        	}
            if ($(validity.field).is('#yyzzfile')) {
            	var yyzzfilename=$("#yyzzfilename");
              	if($.trim(yyzzfilename.val())==''){
            		validity.valid = false;
            		$('#yyzzfile_tips').html("营业执照必填");
            	}
            	else
			    {
			    	validity.valid = true;
                    $('#yyzzfile_tips').html("");
			    }
        	}
        	if ($(validity.field).is('#zzjgfile')) {
        		var zzjgfilename=$("#zzjgfilename");
              	if($.trim(zzjgfilename.val())==''){
            		validity.valid = false;
            		$('#zzjgfile_tips').html("组织结构代码证必填");
            	}
            	else
			    {
			    	validity.valid = true;
                    $('#zzjgfile_tips').html("");
			    }
        	}
        	if ($(validity.field).is('#swdjfile')) {
        		var swdjfilename=$("#swdjfilename");
              	if($.trim(swdjfilename.val())==''){
            		validity.valid = false;
            		$('#swdjfile_tips').html("税务登记证必填");
            	}
            	else
			    {
			    	validity.valid = true;
                    $('#swdjfile_tips').html("");
			    }
        	}
        	if ($(validity.field).is('#wtzmfile')) {
        		var wtzmfilename=$("#wtzmfilename");
              	if($.trim(wtzmfilename.val())==''){
            		validity.valid = false;
            		$('#wtzmfile_tips').html("委托证明必填");
            	}
            	else
			    {
			    	validity.valid = true;
                    $('#wtzmfile_tips').html("");
			    }
        	}
        },
        
        submit: function() {
        	if(this.isFormValid()){
        	
        	$.ajax( {  
	        type : 'POST',  
	        url : '/member/memberxxglnewandedit',  
	        data : $('#my-form').serialize(),  
	        success : function(data) {  
	        	var msg = data.message;
	        	if(msg==1)
        		{
	        		alert('保存成功');
	        		window.location.href="/member/memberxxgl"; 
        		}
	        	else
        		{
		        	alert('保存失败');
        		} 
	        },  
	        error : function(data) {  
	          alert("保存失败")  
	        }  
	      });
        }
        }
    })
	</script>
	<script type="text/javascript" src="${mainDomain}/statics/js/front/hyxxgl.js" charset="UTF-8"></script>
</body>
</html>
